package com.cn.entity;

import javax.persistence.Cacheable;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

/**
 * 用户_业务对应关系列表
 * @author qiu
 *
 */
@Entity
@Table(name = "userbase_smsbusiness")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
@Cacheable
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class UserBase_SMSBusiness {
	
	/**
	 * 用户_业务对应关系ID
	 */
	@Id
	@GeneratedValue(generator = "system-uuid")
	@Column(name = "userbase_smsbusiness_Id", length = 32)
	private String userbase_smsbusiness_Id;
	
	/**
	 * 对应关系所属的用户
	 */
	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.EAGER)
	@JoinColumn(name="userId")
	private UserBase userBase;
	
	/**
	 * 对应关系所属的业务
	 */
	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.EAGER)
	@JoinColumn(name="smsBusinessId")
	private SMSBusiness smsBusiness;
	
	/**
	 * id
	 * @return
	 */
	public String getUserbase_smsbusiness_Id() {
		return userbase_smsbusiness_Id;
	}

	/**
	 * id
	 * @return
	 */
	public void setUserbase_smsbusiness_Id(String userbase_smsbusiness_Id) {
		this.userbase_smsbusiness_Id = userbase_smsbusiness_Id;
	}
	/**
	 * 对应关系所属的用户
	 * @return
	 */
	public UserBase getUserBase() {
		return userBase;
	}

	/**
	 * 对应关系所属的用户
	 * @return
	 */
	public void setUserBase(UserBase userBase) {
		this.userBase = userBase;
	}
	/**
	 * 对应关系所属的业务
	 * @return
	 */
	public SMSBusiness getSmsBusiness() {
		return smsBusiness;
	}

	/**
	 * 对应关系所属的业务
	 * @return
	 */
	public void setSmsBusiness(SMSBusiness smsBusiness) {
		this.smsBusiness = smsBusiness;
	}

	

}
